package com.cskaoyan.gateway.controller.shopping;

import com.mall.commons.result.ResponseData;
import com.mall.commons.result.ResponseUtil;
import com.mall.shopping.IProductService;
import com.mall.shopping.dto.RecommendResponse;
import com.mall.user.annotation.Anoymous;
import org.apache.dubbo.config.annotation.Reference;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author panda
 * @Date 2021/5/23 19:28
 * @Description:
 * @Version 1.0
 */
@Slf4j
@RestController
@RequestMapping("/shopping")
public class RecommendController {
    @Reference(timeout = 3000,check = false)
    IProductService iProductService;

    @GetMapping("/recommend")
    @Anoymous
   public ResponseData recommend(HttpServletRequest request){
        RecommendResponse recommendResponse = iProductService.getRecommendGoods();
        return new ResponseUtil<>().setData(recommendResponse.getPanelContentItemDtos());
    }


}
